//
//  BQSecondCell.m
//  BeeQuick
//
//  Created by Vivitickey on 2017/5/6.
//  Copyright © 2017年 test. All rights reserved.
//

#import "BQSecondCell.h"
#import "BQmyOrderModel.h"
#import "BQorderOpinionModel.h"

@interface BQSecondCell()
@property (weak, nonatomic) IBOutlet UIImageView *img1;
@property (weak, nonatomic) IBOutlet UIImageView *img2;
@property (weak, nonatomic) IBOutlet UIImageView *img3;
@property (weak, nonatomic) IBOutlet UIImageView *img4;
@property (weak, nonatomic) IBOutlet UIImageView *img5;


@end


@implementation BQSecondCell{
    
    
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    
    
    
    
    
}



-(void)setModel:(BQmyOrderModel *)model{
    
    _model = model;
    
    NSMutableArray *dataArray = [NSMutableArray array];
    
    for (int i = 0; i < _model.order_goods.count; i++) {
        NSArray *order = [NSArray yy_modelArrayWithClass:[BQorderOpinionModel class] json:_model.order_goods[i]];
        
        
        BQorderOpinionModel *opModel = order.firstObject;
        
        
        [dataArray addObject:opModel.img];
        
    }
    
    for (int i = 0 ; i < dataArray.count; i++) {
        if (i == 0) {
            [_img1 sd_setImageWithURL:[NSURL URLWithString:dataArray[i]]];
            
            _img5.hidden = YES;
        }else if (i == 1) {
            [_img2 sd_setImageWithURL:[NSURL URLWithString:dataArray[i]]];
            
            _img5.hidden = YES;
        }else if (i == 2) {
            [_img3 sd_setImageWithURL:[NSURL URLWithString:dataArray[i]]];
            
            _img5.hidden = YES;
        }else if (i == 3) {
            [_img4 sd_setImageWithURL:[NSURL URLWithString:dataArray[i]]];
            
            _img5.hidden = YES;
        }else if (i == 4) {
            _img5.hidden = NO;
            
            return;
        }
    }
    
    
}

@end
